123456/H5 2324/functies.php
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Functies</title>
</head>
<body>
<?php
$a = 10;
$b = 20;
$c = verander($a);
$a = $a/10;
echo $a;
function verander($pipo, $mammaloe=10){
global $a;
$a = $a + $pipo * $mammaloe;
return $a;
}
for($leeftijd=8;$leeftijd <=88;$leeftijd = $leeftijd + 1){
echo "<p>";
for($duur=0;$duur <=$leeftijd;$duur = $duur + 5){
$bedrag = contributie($leeftijd, $duur);
//echo "<div>De contributie is $bedrag euro als je $leeftijd bent en $duur jaar lid bent.</div>";
}
echo "</p>";
}
function contributie($leeftijd, $duur){
return (50 + $leeftijd * 5) * (100-$duur)/100 ;
}
?>
</body>
</html>
Resultaat
Made by Thijs Aarnoudse